<!DOCTYPE html>
<html lang="en">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	String basePathCl = request.getScheme()+"://"+request.getServerName()+path+"/";
%>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>开摩邦网(永春)发布会邀请函</title>
<script type="text/javascript" src="<%=basePath%>apply/js/jquery.min.js" ></script>
<script type="text/javascript" src="<%=basePath%>apply/js/swiper.jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>apply/js/swiper.animate.min.js" ></script>
<!-- 微信分享 -->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="<%=basePath%>weixin/js/page/share.js"></script>
<script src="<%=basePath%>weixin/js/jquery.sha1.js"></script>
	<script src="<%=basePath%>weixin/module/layer_pc/layer.js"></script>
<%--<script type="text/javascript" src="<%=basePath%>apply/js/conmon.js" ></script>--%>
<link rel="stylesheet" href="<%=basePath%>apply/css/swiper.min.css">
<link rel="stylesheet" href="<%=basePath%>apply/css/animate.min.css" />
<link rel="stylesheet" href="<%=basePath%>apply/css/base.css" />
</head>
<body>
	<!-- Swiper -->
    <div class="swiper-container">
        <div class="swiper-wrapper">
        	<section class="swiper-slide page-1">
        		<img src="<%=basePath%>apply/img/01/02.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  />
        		<img src="<%=basePath%>apply/img/01/03.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1s"  />
        		<!--<img src="<%=basePath%>apply/img/test/s1-t2.png" class="ani resize" style="width:100px;height:110px;left:70px;top:185px;z-index:3;" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1.5s"  > 
        		<img src="<%=basePath%>apply/img/test/s1-t1.png" class="ani resize" style="width:60px;height:110px;left:220px;top:185px;z-index:3;" swiper-animate-effect="bounceIn" swiper-animate-duration="0.5s" swiper-animate-delay="1s"  > 
        		<img src="<%=basePath%>apply/img/test/flower.png" class="ani resize" style="width:180px;height:220px;left:0;top:0;z-index:2;" swiper-animate-effect="fadeInLeft" swiper-animate-duration="0.5s" swiper-animate-delay="0s"   > 
        		<img src="<%=basePath%>apply/img/test/s1.png"  class="ani resize" style="width:320px;height:200px;left:0px;top:140px;z-index:1;" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  >       -->
        	</section>
        	<section class="swiper-slide page-2">
        		<img src="<%=basePath%>apply/img/02/02.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  />
        		<img src="<%=basePath%>apply/img/02/03.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1s"  />
        	</section>
        	<section class="swiper-slide page-3">
        		<img src="<%=basePath%>apply/img/03/02.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  />
        	</section>
        	<section class="swiper-slide page-4">
        		<img src="<%=basePath%>apply/img/04/02.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  />        		
        		<img src="<%=basePath%>apply/img/04/03.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1s"  />        		
        	</section>
        	<section class="swiper-slide page-5">
        		<img src="<%=basePath%>apply/img/05/02.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  />
        		<img src="<%=basePath%>apply/img/05/03.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1s"  />    
        	</section>
        	<section class="swiper-slide page-6">
        		<img src="<%=basePath%>apply/img/06/02.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="0.5s"  />
        		<img src="<%=basePath%>apply/img/06/03.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1s"  />
        		<img src="<%=basePath%>apply/img/06/04.png" class="ani resize" swiper-animate-effect="fadeIn" swiper-animate-duration="0.5s" swiper-animate-delay="1.5s"  />
        	</section>
        	<section class="swiper-slide page-6">
        		<div class="login">
        			<div class="title"><img src="<%=basePath%>apply/img/text.png" /></div>
        			<table border="0">
        				<tr>
        					<td><div><img src="<%=basePath%>apply/img/text-2.png" /></div></td>
        					<td><div><input name="apply_real_name" type="text" /></div></td>
        				</tr>
        				<tr>
        					<td><div><img src="<%=basePath%>apply/img/text-1.png" /></div></td>
        					<td><div><input name="apply_tel" type="text" /></div></td>
        				</tr>
        				<tr>
        					<td align="left" colspan="2"><a class="submit">报名</a></td>
        				</tr>
        			</table>
        		</div>
        	</section>
        </div>
        <img src="<%=basePath%>apply/img/tip.png" id="array" class="resize"> 
        <div id="audio_btn" class="off rotate" sign="on">
	        <audio loop="" src="http://moto.iwop.cn/moto-images/m.mp3" id="media" autoplay="" preload=""></audio>
	    </div>
    </div>
</body>
<script>
	(function($,window){
		var basePathUrl = '<%=basePath%>';
		window.onload = function(){
			var scaleW = window.innerWidth/320;
			var scaleH = window.innerHeight/480;
			var resizes = document.querySelectorAll('.resize');
			for (var j = 0; j < resizes.length; j++) {
				resizes[j].style.width = parseInt(resizes[j].style.width) * scaleW + 'px';
				resizes[j].style.height = parseInt(resizes[j].style.height) * scaleH + 'px';
				resizes[j].style.top = parseInt(resizes[j].style.top) * scaleH + 'px';
				resizes[j].style.left = parseInt(resizes[j].style.left) * scaleW +'px';
			}
			var scales = document.querySelectorAll('.txt');
			for (var i = 0; i < scales.length; i++) {
				var ss = scales[i].style;
				ss.webkitTransform = ss.MsTransform = ss.msTransform = ss.MozTransform = ss.OTransform = ss.transform =' translateX('+scales[i].offsetWidth*(scaleW-1)/2+'px) translateY('+scales[i].offsetHeight*(scaleH-1)/2+'px)scaleX('+scaleW+') scaleY('+scaleH+') ';
			}
			var mySwiper = new Swiper ('.swiper-container', {
				direction : 'vertical',
				mousewheelControl : true,
				onInit: function(swiper){
					swiperAnimateCache(swiper);
					swiperAnimate(swiper);
				},onSlideChangeEnd: function(swiper){
					swiperAnimate(swiper);
				}});
			$("#audio_btn").click(function(){
				var media = document.getElementById("media");
				var sign = $(this).attr("sign");
				if(sign == "on"){
					$(this).removeClass("rotate").attr("sign","off");
					media.pause();
				}
				else{
					$(this).addClass("rotate").attr("sign","on");
					media.play();
				}
			});
			var isTrue = true;
			document.querySelector('.submit').addEventListener("click",function(){
				var data = {
					apply_type : 'YONGCHOUN_APPLY',
					apply_explain : '开摩邦网(永春)发布会邀请函'
				};
				addData(data,['apply_real_name','apply_tel']);
				if(isEmpty(data.apply_real_name) || isEmpty(data.apply_tel)){
					layer.alert("请填写您的姓名");
					return;
				} else if(!isMobile(data.apply_tel)){
					layer.alert("手机格式不正确");
					return;
				}
				if(isTrue){
					isTrue = false;
					$.ajax({
						type:"get",
						url:basePathUrl+"api/mobom/apply",
						data : data,
						async:true,
						success : function(data){
							if(data.code == 1){
								layer.alert("报名成功！");
							}else{
								layer.alert(data.mem);
							}
							$(".login input").val('');
							isTrue = true;
						}
					});
				}
			});
			function addData(a,ids){
				for(var i = 0; i < ids.length; i++){
					var obj = document.querySelector('input[name="'+ids[i]+'"]');
					if(obj != null){
						a[ids[i]] = obj.value;
					}
				}
			}
			function isNotEmpty(a) {
				return ! isEmpty(a)
			}
			function isMobile(a) {
				return isEmpty(a) || /^[1][3,4,5,7,8]+\d{9}$/.test(a)
			}
			function isEmpty(a) {
				return a == null || a == "" || ("" + a).replace(new RegExp(" ", "g"), "") == ""
			}
		}

	})($,window);

	$(function(){
		var wxShare = {
			id : 'wxe5b8956aa9f1485e',
			ticket : '${ticket}',
			title: '开摩邦网(永春)发布会邀请函',
			desc : '开摩邦网平台(永春)发布会暨“商户+合伙人”入驻推荐会',
			imgUrl : '<%=basePathCl%>/apply/img/mobom_qrcode.jpg',
			link : '<%=basePath%>api/mobom/apply/yc'
		};
		wxShareInit(wxShare);
	});
</script>
</html>